package com.ss.pj.sc04.feign.client;

import com.ss.pj.sc01.pojo.User;
import com.ss.pj.sc01.vo.JsonResult;
import com.ss.pj.sc04.service.fallback.UserFeignServiceFB;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author 叁昇
 * @create 2020-11-24-22:33
 */
@FeignClient(name = "user-service",fallback = UserFeignServiceFB.class)
public interface UserFeignService {
    @GetMapping("/{userId}")
    JsonResult<User> getUser(@PathVariable Integer userId);

    @GetMapping("/{userId}/score")
    JsonResult addScore(@PathVariable Integer userId, @RequestParam Integer score);
}
